<?php
  function genImageTag ($url,$height,$width,$attribs) {
    return '<img src="'.$url.'" height="'.$height.'" width="'.$width.'" '.$attribs.'>';
  }

  function genFlashTag ($url,$height,$width,$attribs) {
    return '<embed src="'.$url.'" height="'.$height.'" width="'.$width.'" '.$attribs.'></embed>';
  }

  function selectImageTag ($type,$url,$height,$width,$attribs) {
     global $shop;
     switch ($type){
        case 'image/jpeg':
           return genImageTag($url,$height,$width,$attribs);
           break;
        case 'image/pjpeg':
           return genImageTag($url,$height,$width,$attribs);
           break;
        case 'image/jpg':
           print genImageTag($url,$height,$width,$attribs);
           break;
        case 'image/gif':
           return genImageTag($url,$height,$width,$attribs);
           break;
        case 'image/x-png':
           return genImageTag($url,$height,$width,$attribs);
           break;
        case 'application/x-shockwave-flash':
           return genFlashTag($url,$height,$width,$attribs);
           break;
     }
  }

  function insertImage ($img_url,$img_height,$img_width,$img_type,$attribs) {
     return selectImageTag($img_type,$img_url,$img_height,$img_width,$attribs);
  }
 
 $praedikate = $GLOBALS['enterprise']['dbap']->getall();

 echo '<table border="0">';
  for ($i=0;$i<count($praedikate);$i++)
 {
    echo '<tr><td colspan="2" class="content"><a name="'.$praedikate[$i]['name'].'"></a><b>'.$praedikate[$i]['name']."</b></td></tr>\n"
          .'<tr><td valign="top" class="content">'.insertImage($praedikate[$i]['infoimg_url'],$praedikate[$i]['infoimg_height'],$praedikate[$i]['infoimg_width'],$praedikate[$i]['infoimg_type'],'border="0" align="left" vspace="3" hspace="3"')."</td>\n"
          .'<td valign="top" class="content">'.$praedikate[$i]['long_descr'].'</td></tr>';
 }
 echo '</table>';
?>
